<ion-view title="任务">
    <!--消息提示 begin-->
    <ion-nav-buttons side="right">
        <button class="button button-clear button-outline" ng-click="openMsgModal()">
            <i class="icon ion-ios-chatbubble-outline"></i>
            <i class="crm-message-dot" ng-if="hasMsg"></i>
        </button>
    </ion-nav-buttons>
    <!--消息提示 end-->
    <div class="tabs-top tabs-striped tabs-background-crm tabs-color-light">
        <div class="tabs">
            <a class="tab-item content-tab" ng-class="{'active':active == $index}" ng-click="onTabChange($index);" ng-repeat="tab in tabs">{{tab.name}}</a>
        </div>
    </div>
    <ion-content ng-repeat="tab in tabs" ng-show="active == $index" class="crm-content has-tabs-top">
        <ion-refresher
                pulling-text="下拉刷新"
                on-refresh="tab.dataList.refresh()">
        </ion-refresher>
        <ul class="list animate-blinds">
            <li class="item item-icon-left item-icon-right ink" ng-repeat="task in tab.dataList.data" ui-sref="app.task-detail({id:task.id})">
                <i class="icon ion-android-drafts" ng-class="{'task-active ion-android-mail':task.isComplete == 2}"></i>
                <h2>{{task.userTask.name}}</h2>
                <p>{{task.createTime | date:'yyyy-MM-dd'}}</p>
            </li>
            <li class='item text-center' ng-if="tab.dataList.loaded && tab.dataList.data.length==0">
                <p>暂无任务</p>
            </li>
        </ul>
        <ion-infinite-scroll
                ng-if="tab.dataList.moreDataCanBeLoaded"
                on-infinite="tab.dataList.loadMore()"
                immediate-check="false"
                distance="5%"
                spinner="dots">
        </ion-infinite-scroll>
    </ion-content>
</ion-view>

<style>
    ion-header-bar {
        box-shadow: none;
    }
</style>